package com.ifast.job.jobs;

import java.io.File;
import java.io.IOException;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.stereotype.Component;



/**
 * <pre>
 * </pre>
 * 
 * <small> 2018年3月22日 | Aron</small>
 */
@Component
public class DeletePDFJob implements Job {
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
    	File directory = new File("");// 参数为空
    	try {
			File file = new File(directory.getCanonicalPath());
			File[] children = file.listFiles();
	    	 for (int i=0; i<children.length; i++) {
	    		 if(children[i].getName().endsWith(".pdf")){
	    			 children[i].delete();
	    		 }
	    	 }
		} catch (IOException e) {
			e.printStackTrace();
		}
    }

}
